home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 7 / Apprentice-Release7.iso / Utilities / Programming / C Reference Card 3.0 / C Reference Card / C Reference Card.rsrc / TEXT_414_14.txt < prev    next >
Encoding:
Text File  |  1997-07-17  |  17.5 KB  |  706 lines

  1. ANSI LIBRARY : stdio, stdlib, string, math, ctype, time, stdarg, ...
  2. _________________________________________________________________________
  3.  
  4.  
  5. This section provides a synopsis of functions available in the standard ANSI C library.  Here's a list of the ANSI C library header files:
  6.  
  7.   <stdio.h>
  8.   <stdlib.h>
  9.   <string.h>
  10.   <math.h>
  11.   <ctype.h>
  12.   <time.h>
  13.   <stdarg.h>
  14.   <limits.h>
  15.   <float.h>
  16.   <assert.h>
  17.   <setjmp.h>
  18.   <signal.h>
  19.   <locale.h>
  20.   <unix.h>
  21.  
  22.  
  23.  
  24. STANDARD INPUT/OUTPUT <stdio.h>
  25. _________________________________________________________________________
  26.  
  27. Filenames are limited to FILENAME_MAX characters.  At most FOPEN_MAX files may be open at a given time.
  28.  
  29. CLEARERR
  30. void clearerr(FILE *stream)
  31.  
  32. FCLOSE
  33. int fclose(FILE *stream)
  34. Returns EOF if error occurs, zero otherwise.
  35.  
  36. FEOF
  37. int feof(FILE *stream)
  38. Returns non-zero if EOF is set.
  39.  
  40. FERROR
  41. int ferror(FILE *stream)
  42. Returns non-zero if error exists for 'stream'.
  43.  
  44. FFLUSH
  45. int fflush(FILE *stream)
  46. Returns EOF if error, zero otherwise.  fflush(NULL) flushes all output streams.
  47.  
  48. FGETC
  49. int fgetc(FILE *stream)
  50. Returns EOF if error.
  51.  
  52. FGETS
  53. char *fgets(char *s, int n, FILE *stream)
  54. Returns s, or NULL if error.
  55.  
  56. FGETPOS
  57. int fgetpos(FILE *stream, fpos_t *ptr)
  58. Records current position in 'stream' in '*ptr'.
  59.  
  60. FOPEN
  61. FILE *fopen(const char *filename, const char *mode)
  62. modes: "r"   read only
  63.        "w"   write; discard previous contents
  64.        "a"   append
  65.        "r+"  read and write
  66.        "rb"  read (binary)
  67.        "wb"  write (binary)
  68.        "ab"  append (binary)
  69.        "r+b" read and write (binary)
  70.  
  71. FPRINTF
  72. int fprintf(FILE *stream, const char *format, ...)
  73. Returns number of characters printed, or negative result if error.  Conversion specification begins with '%' and ends with conversion character.  In between, there may be (in order):
  74. flags:
  75.   '-' left justify
  76.   '+' print with sign
  77.   ' ' <space> prefix with space if no sign
  78.   '0' <zero> specifies padding with leading zeros
  79.   '#' alternate output form
  80. numbers:
  81.    n  first number specifies field width
  82.   '.' period used as separator
  83.    n  second number specifies precision (max characters)
  84.    m  modifier (h - short, l - long, L - long double)
  85. format characters:
  86.   d,i int; signed
  87.    o  int; unsigned octal (without leading zero)
  88.   x,X int; unsigned hexadecimal
  89.    u  int; unsigned
  90.    c  int; single character
  91.    s  char *; string
  92.    f  double;
  93.   e,E double; scientific notation
  94.   g,G double; %e or %f format, depending on value
  95.    p  void *; pointer
  96.    n  int *; number of characters written so far
  97.    %  no argument, print '%'
  98. example:
  99.   fprintf( myFilename, "The results are %d and %6.2f\n", myInt, myReal);
  100.  
  101. FPUTC
  102. int fputc(int c, FILE *stream)
  103. Returns c, or EOF if error.
  104.  
  105. FPUTS
  106. int fputs(const char *s, FILE *stream)
  107. Returns non-negative result, or EOF if error.
  108.  
  109. FREAD
  110. size_t fread(void *ptr, size_t size, size_t nobj, FILE *stream)
  111. Reads from 'stream' into 'ptr' at most 'nobj' objects of size 'size'.  Returns number of objects read.
  112.  
  113. FREOPEN
  114. FILE *freopen(const char *filename, const char *mode, FILE *stream)
  115. Returns NULL if error.
  116.  
  117. FSCANF
  118. int fscanf(FILE *stream, const char *format, ...)
  119. Reads from 'stream' and assigns values through subsequent arguments which must be pointers.  Returns EOF if end of file occurs before any conversion; otherwise it returns number of items assigned.  Format string should contain conversion specifications consisting of '%' followed by:
  120. flag:
  121.    *  suppression; ignore field
  122. number:
  123.    n  first number specifies maximum field width
  124. width character:
  125.    h  short
  126.    l  long
  127.    L  long double
  128. conversion characters:
  129.    d  int *
  130.    i  int *; may be octal (leading 0) or hexadecimal (leading 0x)
  131.    o  int *; octal integer
  132.    x  int *; hexadecimal integer
  133.    c  char *; characters
  134.    s  char *; string of non-white characters
  135.   e,f float *; could also use 'g'
  136.    p  void *; pointer
  137.    n  int *; writes into arg number of characters read.  Nothing read.
  138.  
  139. FSEEK
  140. int fseek(FILE *stream, long offset, int origin)
  141. Sets file position.  Values for origin can be:
  142.   SEEK_SET  beginning
  143.   SEEK_CUR  current position
  144.   SEEK_END  end of file
  145.  
  146. FSETPOS
  147. int fsetpos(FILE *stream, const fpos_t *ptr)
  148. Positions 'stream' at position recorded by fgetpos.  Returns non-zero if error.
  149.  
  150. FTELL
  151. long ftell(FILE *stream)
  152. Returns current position for 'stream', or -1L if error.
  153.  
  154. FWRITE
  155. size_t fwrite(const void *ptr, size_t size, size_t nobj, FILE *stream)
  156. Writes from 'ptr' to 'stream' 'nobj' objects of size 'size'.  Returns number of objects read.
  157.  
  158. GETC
  159. int getc(FILE *stream)
  160. Same as fgetc, except a macro.
  161.  
  162. GETCHAR
  163. int getchar(void)
  164. Equivalent to getc(stdin).
  165.  
  166. GETS
  167. char *gets(char *s)
  168. Returns s, or NULL if error.
  169.  
  170. PERROR
  171. void perror(const char *s)
  172. Prints error message 's'.
  173.  
  174. PRINTF
  175. int printf(const char *format, ...)
  176. Equivalent to fprintf(stdout, ...)
  177.  
  178. PUTC
  179. int putc(int c, FILE *stream)
  180. Same as fputc, except a macro.
  181.  
  182. PUTCHAR
  183. int putchar(int c)
  184. Equivalent to putc(c, stdout).
  185.  
  186. PUTS
  187. int puts(const char *s)
  188. Returns non-negative result, or EOF if error.
  189.  
  190. REMOVE
  191. int remove(cost char *filename)
  192. Returns non-zero if attempt to delete file fails.
  193.  
  194. RENAME
  195. int rename(const char *oldname, const char *newname)
  196. Returns non-zero if attempt to rename file fails.
  197.  
  198. REWIND
  199. void rewind(FILE *stream)
  200.  
  201. SCANF
  202. int scanf(const char *format, ...)
  203. Identical to fscanf(stdin, ...)
  204.  
  205. SPRINTF
  206. int sprintf(char *s, const char *format, ...)
  207. Same as printf except output written to string 's'.
  208.  
  209. SSCANF
  210. int sscanf(char *s, const char *format, ...)
  211. Equivalent to scanf(...) except input is taken from 's'.
  212.  
  213. SETBUF
  214. void setbuf(FILE *stream, char *buf)
  215. If 'buf' is NULL, buffering is turned off, otherwise equivalent to 'void setvbuf(stream, buf, _IOFBF, BUFSIZE)'.
  216.  
  217. SETVBUF
  218. int setvbuf(FILE *stream, char *buf, int mode, size_t size)
  219. Returns non-zero if error.  A value of NULL for 'buf' allocates buffer.
  220. modes: _IOFBF  full buffering
  221.        _IOLBF  line buffering
  222.        _IONBF  no buffering
  223.  
  224. TMPFILE
  225. FILE *tmpfile(void)
  226. Returns NULL if error.
  227.  
  228. TMPNAM
  229. char *tmpnam(char s[L_tmpnam])
  230. tmpnam(NULL) creates unique filename.  TMP_MAX different names guaranteed.
  231.  
  232. UNGETC
  233. int ungetc(int c, FILE *stream)
  234. pushes 'c' (converted to an unsigned char) back onto 'stream'.  Returns 'c' or EOF if error.
  235.  
  236. VPRINTF
  237. int vprintf(const char *format, va_list arg)
  238.  
  239. VFPRINTF
  240. int vfprintf(FILE *stream, const char *format, va_list arg)
  241.  
  242. VSPRINTF
  243. int vsprintf(char *s, const char *format, va_list arg)
  244.  
  245.  
  246.  
  247. STANDARD LIBRARY <stdlib.h>
  248. _________________________________________________________________________
  249.  
  250. ABORT
  251. void abort(void)
  252. Causes program to abnormally terminate.
  253.  
  254. ABS
  255. int abs(int n)
  256.  
  257. ATEXIT
  258. int atexit(void (*fcn)(void))
  259. Registers function to be called when program terminates.  Returns non-zero if error.
  260.  
  261. ATOF
  262. double atof(const char *s)
  263.  
  264. ATOI
  265. int atoi(const char *s)
  266.  
  267. ATOL
  268. long atol(const char *s)
  269.  
  270. BSEARCH
  271. void *bsearch(const void *key, const void *base, size_t n, size_t size, int (*cmp)(const void *keyval, const void *datum))
  272.  
  273. CALLOC
  274. void *calloc(size_t nobj, size_t size)
  275.  
  276. DIV
  277. div_t div(int num, int denom)
  278.  
  279. EXIT
  280. void exit(int status)
  281. Causes normal program termination.
  282.  
  283. FREE
  284. void free(void *p)
  285. Deallocates spaced pointed to by 'p'.  Returns NULL if error.
  286.  
  287. GETENV
  288. char *getenv(const char *name)
  289.  
  290. LABS
  291. long labs(long n)
  292.  
  293. LDIV
  294. ldiv_t ldiv(long num, long denom)
  295.  
  296. MALLOC
  297. void *malloc(size_t size)
  298. Returns pointer for object of size 'size', or NULL if request for memory denied.
  299.  
  300. MBLEN
  301. int mblen(const char *s, size_t n)
  302. Multi-byte function.  Returns number of bytes of character s.
  303.  
  304. MBSTOWCS
  305. size_t mbstowcs(wchar_t *pwcs, const char *s, size_t n)
  306. Multi-byte function.  Copies elements of s to pcws, stopping after it copies n elements or a NULL character.  Returns number of characters copied.
  307.  
  308. MBTOWC
  309. int mbtowc(wchar_t *pwc, const char *s, size_t n)
  310. Multi-byte function.  Sets pwc to the first element of s if s is not NULL and n is not zero.  Returns 1 if successful, zero if s is NULL, and -1 if n is zero.
  311.  
  312. QSORT
  313. void qsort(void *base, size_t n, size_t size, int (*cmp)(const void *, const void *))
  314.  
  315. RAND
  316. int rand(void)
  317. Returns pseudo-random integer between 0 and RAND_MAX.
  318.  
  319. REALLOC
  320. void *realloc(void *p, size_t size)
  321.  
  322. STRTOD
  323. double strtod(const char *s, char **endp)
  324.  
  325. STRTOL
  326. long strtol(const char *s, char **endp, int base)
  327.  
  328. STRTOUL
  329. unsigned long strtoul(const char *s, char **endp, int base)
  330.  
  331. SRAND
  332. void srand(unsigned int seed)
  333.  
  334. SYSTEM
  335. int system(const char *s)
  336. If system provides a command processor, executes command line in s.  If s is NULL and there is a command processor, returns non-zero value, otherwise returns zero.
  337.  
  338. WCSTOMBS
  339. size_t wcstombs(wchar_t *pwcs, const char *s, size_t n)
  340. Multi-byte function.  Copies elements of pwcs to s, stopping after it copies n elements or the NULL character.  Returns the number of characters copied.
  341.  
  342. WCTOMB
  343. int wctomb(char *s, wchar_t wchar)
  344. Multi-byte function.  Sets first element of s to wchar if s is not NULL.
  345.  
  346.  
  347.  
  348. STRING FUNCTIONS <string.h>
  349. _________________________________________________________________________
  350.  
  351. MEMCHR
  352. void *memchr(const char *cs, int c, size_t n)
  353. Returns first occurrence of character 'c' in 'cs' or NULL.
  354.  
  355. MEMCMP
  356. int memcmp(const char *cs, const char *ct, size_t n)
  357. Compares 'n' characters of 'cs' with 'ct'.
  358.  
  359. MEMCPY
  360. void *memcpy(char *s, const char *ct, size_t n)
  361. Copy 'n' characters from 'ct' to 's', returns 's'.
  362.  
  363. MEMMOVE
  364. void *memmove(char *s, const char *ct, size_t n)
  365. Same as 'memcpy'.  Works if objects overlap.
  366.  
  367. MEMSET
  368. void *memset(char *s, int c, size_t n)
  369. Put character 'c' into first 'n' characters of 's', returns 's'.
  370.  
  371. STRCAT
  372. char *strcat(char *char *s, const char *ct)
  373. Concatenates 'ct' to 's', returns 's'.
  374.  
  375. STRCHR
  376. char *strchr(const char *cs, int c)
  377. Returns pointer to first occurrence of 'c' in 'cs' or NULL.
  378.  
  379. STRCMP
  380. int strcmp(const char *cs, const char *ct)
  381. Returns zero if cs == ct.
  382.  
  383. STRCOLL
  384. int strcoll(const char *cs, const char *ct)
  385. Compare strings based on locale environment.  Equivalent to strcmp.
  386.  
  387. STRCPY
  388. char *strcpy(char *s, const char *ct)
  389. Copies 'ct' to 's', including '\0', returns 's'.
  390.  
  391. STRCSPN
  392. size_t strcspn(const char *cs, const char *ct)
  393.  
  394. STRERROR
  395. char *strerror(n)
  396. Returns pointer to string defining error 'n'.
  397.  
  398. STRLEN
  399. size_t strlen(const char *cs)
  400. Returns length of 'cs'.
  401.  
  402. STRNCAT
  403. char *strncat(char *s, const char *ct, size_t n)
  404.  
  405. STRNCMP
  406. int strncmp(const char *cs, const char *ct, size_t n)
  407. Returns zero if 'n' characters of both strings are equal.
  408.  
  409. STRNCPY
  410. char *strncpy(char *s, const char *ct, size_t n)
  411.  
  412. STRPBRK
  413. char *strpbrk(const char *cs, const char *ct)
  414. Return pointer to first occurrence of any character in 'ct' or NULL.
  415.  
  416. STRRCHR
  417. char *strrchr(const char *cs, int c)
  418. Returns pointer to last occurrence of 'c' in 'cs' or NULL.
  419.  
  420. STRSPN
  421. size_t strspn(const char *cs, const char *ct)
  422.  
  423. STRSTR
  424. char *strstr(const char *cs, const char *ct)
  425. Returns pointer to first occurrence of string 'ct' in 'cs' or NULL.
  426.  
  427. STRTOK
  428. char *strtok(char *s, const char *ct)
  429. Searches 's' for tokens delimited by characters from 'ct'.  Returns NULL when no further tokens found.
  430.  
  431. STRXFRM
  432. size_t strxfrm(char *cs, const char *ct, size_t n)
  433. Copies the first n characters of ct into cs.  If n is zero, cs can be NULL.  Equivalent to strncpy except strxfrm returns length of ct.
  434.  
  435.  
  436.  
  437. MATH FUNCTIONS <math.h>
  438. _________________________________________________________________________
  439.  
  440. In the following list, 'x' and 'y' are type 'double', n is type 'int'.  All angles for trigonometric functions are in radians.
  441.  
  442.   sin(x)
  443.   cos(x)
  444.   tan(x)
  445.   asin(x)
  446.   acos(x)
  447.   atan(x)
  448.   atan2(y,x)
  449.   sinh(x)
  450.   cosh(x)
  451.   tanh(x)
  452.   exp(x)
  453.   log(x)
  454.   log10(x)
  455.   pow(x,y)
  456.   sqrt(x)
  457.   ceil(x)
  458.   floor(x)
  459.   fabs(x)
  460.   ldexp(x,n)
  461.   frexp(x, int *exp)
  462.   modf(x, double *ip)
  463.   fmod(x,y)
  464.  
  465.  
  466.  
  467. CHARACTER TESTS <ctype.h>
  468. _________________________________________________________________________
  469.  
  470. All functions in <ctype.h> take a character and return an 'int' which represents a true (non-zero) or false (zero) result.
  471.  
  472.   isalnum(int c)   alpha-numeric character
  473.   isalpha(int c)   upper or lower-case letter
  474.   iscntrl(int c)   control character
  475.   isdigit(int c)   decimal digit
  476.   isgraph(int c)   !space
  477.   islower(int c)   lower-case
  478.   isprint(int c)   printing character, including space
  479.   ispunct(int c)   !(space || letter || digit)
  480.   isspace(int c)   space, tab, newline
  481.   isupper(int c)   upper-case
  482.   isxdigit(int c)  hexadecimal digit
  483.   tolower(int c)   converts and returns lowercase letter
  484.   toupper(int c)   converts and returns uppercase letter
  485.  
  486.  
  487.  
  488. DATA AND TIME FUNCTIONS <time.h>
  489. _________________________________________________________________________
  490.  
  491. Many functions in <time.h> utilize a data structure which has the following format:
  492.  
  493.   struct tm
  494.   {
  495.     int tm_sec;
  496.     int tm_min;
  497.     int tm_hour;
  498.     int tm_mday;
  499.     int tm_mon;
  500.     int tm_year;
  501.     int tm_wday;
  502.     int tm_yday;
  503.     int tm_isdst;  // Daylight Savings Time flag
  504.   };
  505.  
  506. ASCTIME
  507. char *asctime(const struct tm *tp)
  508. Converst time into standard string; "Fri May 26 19:27:30 1995\n".
  509.  
  510. CLOCK
  511. clock_t clock(void)
  512. Returns processor time used by the program.
  513.  
  514. CTIME
  515. char *ctime(const time_t *tp)
  516. Converts calendar time to local time.
  517.  
  518. DIFFTIME
  519. double difftime(time_t time2, time_t time1)
  520. Returns difference in two times in seconds.
  521.  
  522. GMTIME
  523. struct tm *gmtime(const time_t *tp)
  524. Converts calendar time into Coordinated Universal Time (UTC).
  525.  
  526. LOCALTIME
  527. struct tm *localtime(const time_t *tp)
  528. Converts calendar time into local time.
  529.  
  530. MKTIME
  531. time_t mktime(struct tm *tp)
  532. Converts local time to calendar time.
  533.  
  534. STRFTIME
  535. size_t strftime(char *s,size_t smax,const char *fmt,const struct tm *tp)
  536. Formats date and time data from *tp into string 's'.  Available formats include:
  537.   %a  abbriviated weekday name
  538.   %A  full weekday
  539.   %b  abbreviated month
  540.   %B  full month
  541.   %c  date and time
  542.   %d  day of month (01-31)
  543.   %H  hour (24 hr)
  544.   %I  hour (12 hr)
  545.   %j  day of year
  546.   %m  month
  547.   %M  minute
  548.   %p  AM or PM
  549.   %S  second
  550.   %U  week number (Sunday 1st day of week)
  551.   %w  weekday (0-6)
  552.   %W  week number (Monday 1st day of week)
  553.   %x  date
  554.   %X  time
  555.   %y  year without century
  556.   %Y  century
  557.   %Z  time zone name
  558.   %%  %
  559.  
  560. TIME
  561. time_t time(time_t *tp)
  562. Returns current calendar time.  If 'tp' is not NULL, return value is also assigned to 'tp'.
  563.  
  564.  
  565.  
  566. VARIABLE ARGUMENT LISTS <stdarg.h>
  567. _________________________________________________________________________
  568.  
  569. Use the functions in <stdarg.h> to retrieve arguments from a variable length function argument list.  An example of using variable argument lists can be found in Section 'Functions'.  Before using functions, you must declare a variable of type 'va_list' as follows:
  570.  
  571.   va_list ap;
  572.  
  573. You then use the 'va_start' macro to initialize.  Afterwords, each subsequent call to 'va_arg' returns the next argument.  Finally, call 'va_end'.
  574.  
  575. VA_START
  576. void va_start(va_list ap, lastarg)
  577. Provide the last argument in a variable length function list as 'lastarg' to initialize va_list variable.
  578.  
  579. VA_ARG
  580. type va_arg(va_list ap, type)
  581. Returns next argument in variable length function list.  You must supply the data type in 'type'.  va_arg returns type specified in 'type'.
  582.  
  583. VA_END
  584. void va_end(va_list ap)
  585. Execute after arguments have been processed, but prior to exiting function.
  586.  
  587.  
  588.  
  589. IMPLEMENTATION SPECIFICS <limits.h> and <float.h>
  590. _________________________________________________________________________
  591.  
  592. The following constants are defined in <limits.h>:
  593.  
  594.   CHAR_BIT
  595.   CHAR_MAX
  596.   CHAR_MIN
  597.   INT_MAX
  598.   INT_MIN
  599.   LONG_MAX
  600.   LONG_MIN
  601.   SCHAR_MAX
  602.   SCHAR_MIN
  603.   SHRT_MAX
  604.   SHRT_MIN
  605.   UCHAR_MAX
  606.   UINT_MAX
  607.   ULONG_MAX
  608.   USHRT_MAX
  609.  
  610. The following constants are defined in <float.h>:
  611.  
  612.   FLT_RADIX
  613.   FLT_ROUNDS
  614.   FLT_DIG
  615.   FLT_EPSILON
  616.   FLT_MANT_DIG
  617.   FLT_MAX
  618.   FLT_MAX_EXP
  619.   FLT_MIN
  620.   FLT_MIN_EXP
  621.   DBL_DIG
  622.   DBL_EPSILON
  623.   DBL_MANT_DIG
  624.   DBL_MAX
  625.   DBL_MAX_EXP
  626.   DBL_MIN
  627.   DBL_MIN_EXP
  628.  
  629.  
  630.  
  631. DIAGNOSTICS <assert.h>
  632. _________________________________________________________________________
  633.  
  634. ASSERT
  635. void assert(int expr)
  636. If 'expr' is zero, prints error message on stderr.  If NDEBUG is defined, assert macro is ignored.
  637.  
  638.  
  639.  
  640. NON-LOCAL JUMPS <setjmp.h>
  641. _________________________________________________________________________
  642.  
  643. SETJMP
  644. int setjmp(jmp_buf env)
  645. Saves state information for later use by 'longjmp'.
  646.  
  647. LONGJMP
  648. void longjmp( jmp_buf env, int val)
  649. Restores state saved by most recent call to setjmp.  Execution resumes as if the setjmp function had just executed and returned the non-zero value val.  Function containing setjmp must not have terminated.
  650.  
  651.  
  652.  
  653. SIGNALS <signal.h>
  654. _________________________________________________________________________
  655.  
  656. SIGNAL
  657. void (*signal(int sig, void (*handler)(int)))(int)
  658. Calls function pointed to by handler with argument of the type of signal.
  659.   SIG_DFL  default behavior: handler ignored
  660.   SIG_IGN  ignore signal: handler ignored
  661.   SIGABRT  abnormal termination
  662.   SIGFPE   arithmetic error
  663.   SIGILL   illegal instruction
  664.   SIGINT   interrupt
  665.   SIGSEGV  illegal storage access
  666.   SIGTERM  termination request
  667.  
  668. RAISE
  669. int raise( int sig )
  670. Sends the signal 'sig' to the program, returns non-zero if unsuccessful.
  671.  
  672.  
  673.  
  674. LOCALE <locale.h>
  675. _________________________________________________________________________
  676.  
  677. LOCALECONV
  678. struct lconv *localeconv(void)
  679. Returns structure of formatting requirements according to the rules of the current locale.
  680.  
  681. SETLOCALE
  682. char *setlocale(int category, const char *locale)
  683. Sets locale environment.  The parameter category can be one of the following:
  684.   LC_ALL
  685.   LC_COLLATE
  686.   LC_TYPE
  687.   LC_MONETARY
  688.   LC_NUMERIC
  689.   LC_TIME
  690.  
  691.  
  692.  
  693. UNIX <unix.h>
  694. _________________________________________________________________________
  695.  
  696. FSTAT
  697. int fstat(int fn, struct stat *statptr)
  698. Returns file information into statptr data structure.  Returns zero if successful.
  699.  
  700. PUTW
  701. int putw(int word, FILE *stream)
  702. Writes word to stream.  Returns word is successful, EOF if not.
  703.  
  704. STAT
  705. int stat(char *filename, struct stat *statptr)
  706. Returns file information about filename into statptr data structure.  Returns zero if successful.